<?php

namespace App\Events;

use Illuminate\Broadcasting\PrivateChannel;

class TestEvent extends Event
{
    public $data;
    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        //
        $data['ip'] = $_SERVER["REMOTE_ADDR"];
        $data['open_time'] = date('Y-m-d H:i:s', time());
        $this->data = $data;
    }

    public function getData()
    {
        return $this->data;

    }

    public function broadcastOn(){
        return new PrivateChannel("channel-name");
    }
}
